import request from '@/utils/axios/axios-service.ts'

/**
 * 验证码发送记录
 */
export const captchaLogList = (params: any) => request.get('/captcha_log/list', {params: params})

/**
 * 系统通知接口
 */
export const messageNoticeList = (params: any) => request.get('/message/notice/list', {params: params})
export const messageNoticeInfo = (id: number) => request.get('/message/notice/info/' + id)
export const messageNoticeSaveOrUpdate = (params: any, isCreate: boolean) => request.post(isCreate ? '/message/notice/create' : '/message/notice/update', params)

/**
 * Ocr识别接口
 */
export const ocrRecognize = (params: any,data:any) => request.post('/v1/ocr', params, {params:data})

/**
 * 银行信息检索接口
 */
export const bankBranchList = (params: any) => request.get('/bank_branch/list', {params: params})
export const bankBranchInfo = (id: number) => request.get('/bank_branch/info/' + id)
export const bankBranchSaveOrUpdate = (params: any, isCreate: boolean) => request.post(isCreate ? '/bank_branch/create' : '/bank_branch/update', params)
export const bankBranchSearch = (params: any) => request.get('/search/bank_branch', {params: params})

/**
 * 其他接口
 */
export const copyright = () => request.get('/common/copyright')

export type MessageNotice = {
  id: number;
  type: number;
  title: string;
  content: string;
  image_urls: string;
  popup_window: boolean;
  jump_type: number;
  jump_content: string;
  publish_time: string;
  enabled: boolean;
  create_by: number;
  create_user: string;
  update_by?: number;
  update_user?: string;
};

export type BankBranch = {
  id: number;
  code: string;
  name: string;
  unionpay_code: string;
  bank_code: string;
  bank_name: string;
  region_code: number;
  region_name: string;
  province_code: number;
  city_code: number;
  county_code: number;
  enabled: boolean;
};
